<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="zozopo.attendance.*" %>
<%@ page import="zozopo.attendance.operations.*" %>

<%@taglib prefix="s" uri="/struts-tags"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML>
<html>
  <head>
    
    <title>考勤管理 </title>
    
	
	
	<link rel="stylesheet" type="text/css" href="../css/manual.css">
	
  </head>
  
  <body>
  
  <table  width="100%"  border="0" cellpadding="0" cellspacing="0" height="100%">
  	<tr valign="top">
  	
  		<td height="100">
  			 <jsp:include page="/background/head.jsp"></jsp:include>
  		</td>
  	</tr>
  	<tr valign="top">
  		<td>
  		
   
   
  <table width="100%"  border="0" cellpadding="0" cellspacing="0">
  
 <tr>
    	<td width="270" align="center">
    		
    	</td>
    	<td width="100%">

    	</td>
    </tr>
    
    <tr>
    	<td valign="top">
     		<div>
     		
     		</div>
					<s:include value="/background/operator/left.jsp"></s:include>		
     	</td>
     	
     	
     	<td valign="top" >
     	
     	<table width="100%" border="0" cellpadding="0" bgcolor="#e5f3ff" cellspacing="0" style= "border:1px solid #ffffff; border-top-color:#6cb1f1;">
     		<tr>
     			<td>考勤信息
     			
     			<input type="button" value="查看谁有权限" 
     				onclick="javascript:openUrlForDialog('selectoperatorlimitedAction_background.action?limitedCode=<s:property value="limitedcode"/>')"/>
     			</td>
     			<td align="right"> <a href="#">请假记录</a> <a href="manageoperaotr_attendance.action">人员管理</a> </td>
     		</tr>
     	</table>
     	
     	<table align="center">
     		<tr>
     			<td><s:fielderror id="errormessage" /></td>
     		</tr>
     	</table>
     	
    <form id="managereceiptlist_warehouse" name="managereceiptlist_warehouse" onSubmit="return true;" action="manageaftersaleservice_warehouse.action" method="POST" >
    	
			<table  border="0" >
				<tr>
				  <td>
					  查找考勤信息:<input type="text" name="searchStr" size="30" value="<s:property value="searchStr"/>"/>
					  <input type="submit" value="查找" />
				  </td>
			  </tr>
			</table>
	</form> 
	
	
		
		
		
		
		<table >
			
		
			<%
			Map<Integer,List<OperatorOfAttendanceTB>> weekRestdayListMap = (Map<Integer,List<OperatorOfAttendanceTB>>)request.getAttribute("weekRestdayListMap");
			
			Date d = new java.util.Date();
			 Calendar calendar =Calendar.getInstance();
			 
			 for(int i=0;i<30;i++){
			
				 /**
				  * 根据日历的规则，为给定的日历字段添加或减去指定的时间量。例如，要从当前日历时间减去 5 天，可以通过调用以下方法做到这一点：  
				add(Calendar.DAY_OF_MONTH, -5)。  
				参数：
				field - 日历字段。
				amount - 为字段添加的日期或时间量。
				  *  
				 * 参照jdk
				  * */
				d=calendar.getTime();
				 
				 
				 java.text.SimpleDateFormat dformat = new java.text.SimpleDateFormat("yyyy-MM-dd");
				 String datetime = dformat.format(d);  
				 
				 List<OperatorOfAttendanceTB> restdayList = weekRestdayListMap.get(calendar.get(Calendar.DAY_OF_WEEK)-1);
				 
			%>
		
				<tr>

					<td>
						<% if((calendar.get(Calendar.DAY_OF_WEEK)-1) == 0){ %>
						<table border="0" cellpadding="0"  cellspacing="0" width="100%"  style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff">
									<tr>
										<td>
											<table bgcolor="#ff7f27" width="100%" >
												<tr>
													<td>
													星期<%=calendar.get(Calendar.DAY_OF_WEEK)-1 %>
													</td>
													
												 	
												</tr>
											</table> 
											
											<%}else{%>
											
											<table border="0" cellpadding="0"  cellspacing="0" width="100%"    style= "border:1px solid #ffffff; border-bottom-color:#b2d5ff;
    border-left-color:#b2d5ff;border-right-color:#b2d5ff;border-top-color:#b2d5ff">
									<tr>
										<td>
											<table bgcolor="#f3f7fc" width="100%" >
												<tr>
													<td>
													星期<%=calendar.get(Calendar.DAY_OF_WEEK)-1 %>
													</td>
													
												 	
												</tr>
											</table> 
											
											<%} %>
										</td>
									</tr>
									<tr>
										<td>
											<table border="1" cellpadding="0"  cellspacing="0" bordercolor="#f5f5f5" style="border-collapse:collapse; border-width:1px 0 0 1px;">
												<tr>
													<td>
														<p>
																	<%=datetime %>
																	</p>
																	
													</td>
												
													<td width="435" >
													
													
													
													
														<table >
															<tr>
																
																<td width="305">
																
																	<font color="green">
																	休息:
																	<%for(OperatorOfAttendanceTB operatorOfAttendance:restdayList){ %>
																	<%=operatorOfAttendance.getName_operator() %>
																	<%} %>
																	</font>
																	
																	
																	
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
															
															
															<tr>
																
																<td width="305">
																<font color="green">
																	调休:<s:property value="#aftersaleserviceList.goodsinfo_aftersaleservice"/>
																	</font>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
															
															
															<tr>
																
																<td width="305">
																<font color="green">
																	请假:<s:property value="#aftersaleserviceList.goodsinfo_aftersaleservice"/>
																	</font>
																</td>
																
																<td width="105" align="center">
																
																
																
															
																</td>
															</tr>
														</table>
													
													
														
													</td>
													
													<td align="center" width="185">
														<font color="green">
														<s:property value="#aftersaleserviceList.receiveshipno_aftersaleservice"/>
														</font>
														</br>
														<s:if test="#aftersaleserviceList.shipno_aftersaleservice != null "> 
														<font color="red">
														<s:property value="#aftersaleserviceList.shipno_aftersaleservice"/>
														</font>
														</s:if>
													</td>
													
													<td align="center" title="<s:property value="#aftersaleserviceList.customerinfo_aftersaleservice"/>">
														<s:property value="#aftersaleserviceList.customerid_aftersaleservice"/>
													</td>
													
													<td align="center">
														
														
														
													</td>
													
													<td align="center">
													
															
														<button>
															请假
														</button>
													
													</td>
												</tr>
											</table>
										</td>
									</tr>
									<s:if test="#aftersaleserviceList.remark_aftersaleservice!=''">
									<tr>
										<td bgcolor="fff7d9">
											备注：<s:property value="#aftersaleserviceList.remark_aftersaleservice"/>
										</td> 
									</tr>
									</s:if>
									
									
							</table>
					
					
					
						
					</td>
					
					
					
						
							
				
				</tr>
				
				<%
				calendar.add(Calendar.DAY_OF_YEAR, 1);
				
						 }
				%>
				
				
		</table>
	
	
			
	</td>
	
	
	
</tr>

</table>

</td>
</tr>
<tr valign="bottom">
	<td>
		<jsp:include page="/background/operator/tail.jsp"></jsp:include>
	</td>
</tr>
</table>

</td>
</tr>
</table>

  </body>

</html>
